const express = require('express');
const verify = require('../middlewares/verify');
const path = require('path');
const router = express.Router();

const viewPath = path.resolve(__dirname+'../../../client/views');

//显示主页（解决跨域）
router.get('/',verify,(req,res) => {
    res.sendFile(viewPath+'/index.html');
});

//显示登录页
router.get('/login',(req,res) => {
    res.sendFile(viewPath+'/login.html');
});

//显示注册页
router.get('/register',(req,res) => {
    res.sendFile(viewPath+'/register.html');
});

//显示个人中心
router.get('/center',verify,(req,res) => {
    res.sendFile(viewPath+'/center.html');
});

//显示注册倒计时页
router.get('/countDown-center',(req,res) => {
    res.sendFile(viewPath+'/countDown-center.html');
});

//显示退出倒计时页
router.get('/countDown-login',(req,res) => {
    res.sendFile(viewPath+'/countDown-login.html');
});

//显示添加页
router.get('/add',verify,(req,res) => {
    res.sendFile(viewPath+'/add.html');
});

//显示编辑页
router.get('/edit',verify,(req,res) => {
    res.sendFile(viewPath+'/edit.html');
});

module.exports = router;